export default {
  data() {
    return {}
  },
  methods: {
    tableRowClassName({ row }) {
      if (row.finishstatus === '超期未完成') {
        return 'danger-row';
      } else if (row.finishstatus === '超期完成') {
        return 'warning-row';
      } else if (row.finishstatus === '按时完成') {
        return 'success-row';
      } else {
        return '';
      }
    }
  },
  props: {
    workstationname: { type: String },
    dataList: { type: Array },
    showDetail: { type: Function },
    zoom: { type: String }
  },
  template: `
    <div>
      <h6>{{workstationname}}</h6>
      <el-table :data="dataList" border height="140" :style="{'zoom':zoom}" :row-class-name="tableRowClassName">
        <el-table-column label="发动机号" prop="machineno" style="background:red;" show-overflow-tooltip></el-table-column>
        <el-table-column label="任务名称" prop="description" style="background:red;" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-link type="primary" @click="showDetail(scope.row)">{{scope.row.description}}</el-link>
          </template>
        </el-table-column>
      </el-table>
    </div>
  `
}